package com.naiterui.ehp.bs.esign.api.scca.entity;/**
 * @author guoyongxiang
 * @date 2021/2/26 13:30
 * @since 1.0.0
 */

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;
import lombok.Builder;
import lombok.Data;

/**
 * 四川CA签名信息记录
 *
 * @author guoyongxiang
 * @version 1.0.0
 * @date 2021/2/26 13:30
 **/
@Builder
@Data
@Table(name = "esign_scca_sign_info")
@Entity
public class EsignSccaSignInfo {

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    private Long id;

    @Column(name = "sign_id")
    private String signId;

    @Column(name = "open_id")
    private String openId;

    @Column(name = "sha1_hash")
    private String sha1Hash;

    /**
     * 签名算法
     */
    @Column(name = "sign_method")
    private String signMethod;

    /**
     * P7签名值
     */
    @Basic(fetch = FetchType.LAZY)
    @Column(name = "sign_p7", columnDefinition = "text")
    private String signP7;

    /**
     * P1签名值
     */
    @Column(name = "sign_bare")
    private String signBare;

    /**
     * 证书序列号
     */
    @Column(name = "cert_serialnumber")
    private String certSerialnumber;

    /**
     * 证书base64
     */
    @Basic(fetch = FetchType.LAZY)
    @Column(name = "cert_base64", columnDefinition = "text")
    private String certBase64;

    @Column(name = "created_at")
    private Date createdAt;

    @Version
    private Integer version;
}
